<?php
header("Content-type: text/xml");

$link = "https://accounts.internode.on.net/cgi-bin/login";

echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">
	<channel>
		<title>Internode ADSL Usage</title>
		<link><?= $link ?></link>
		<description>Internode ADSL Usage for <?= $this->api->username ?>@internode.on.net</description>
		<language>en-au</language>
		<copyright>Copyright 2004 Intellectual Property Holdings Pty. Ltd.</copyright>
		<docs>http://www.cafuego.net/internode-usage.php</docs>
		<generator>Internode Usage v.<?= $this->api->internode_version ?> - PHP <?= phpversion() ?></generator>
		<lastBuildDate><?= strftime("%d/%m/%Y %H:%M:%S %Z") ?></lastBuildDate>
		<managingEditor><?= $this->api->username ?>@internode.on.net</managingEditor>
		<webMaster>webmaster@internode.on.net</webMaster>
		<ttl>3600</ttl>
		<item>
			<title>Used: <?= sprintf("%.2f Gb", $this->api->used/1000 ) ?></title>
			<link><?= $link ?></link>
		</item>
<? if(!$this->unlimited) : ?>
		<item>
			<title>Quota: <?= sprintf("%d Gb", $this->api->quota/1000 ); ?></title>
			<link><?= $link ?></link>
		</item>
		<item>
			<title>Remaining: <?= sprintf("%.2f Gb", $this->api->quota_remaining/1000 ); ?></title>
			<link><?= $link ?></link>
		</item>
		<item>
			<title>Percentage: <?= sprintf("%.2f %%", $this->api->quota_percentage ); ?></title>
			<link><?= $link ?></link>
		</item>
		<item>
			<title>Remaining per day: <?= sprintf("%.2f Mb", ($this->api->quota_remaining / $this->api->days_remaining) ); ?></title>
			<link><?= $link ?></link>
		</item>
<? endif; ?>
	</channel>
</rss>